package com.woniuxy.woniuticket.ordermodule.service;

import com.woniuxy.woniuticket.ordermodule.dto.CartDTO;
import com.woniuxy.woniuticket.ordermodule.dto.OrderDTO;
import com.woniuxy.woniuticket.pojo.CinemaOder;

import java.util.List;

/**
 * Created by Wu xianbo on 2019/6/1
 *
 * 订单service
 */

public interface OrderService {

    //创建订单
    public CinemaOder creatOrder(CartDTO cartDTO);

    //根据订单号查询订单
    public OrderDTO findOrderByOrderNumber(String ordernum);

    //商家查询所有订单
    public List<OrderDTO> findAllOrder(Integer cpage, Integer psize);

    //根据用户id查询用户所有订单
    public List<OrderDTO> findAllOrderByUid(Integer userid,Integer orderType);

    //订单支付（第三个参数为可能存在改签订单）
    public CinemaOder payOrder(String orderNumber,Integer userInfoId,Object oldOrderNum);

    //订单改签
    public CinemaOder changeOrder(CinemaOder cinemaOder);

    //订单退费（第一个参数为退费订单，第二个参数表示可能存在改签订单的退费,这两个参数值一样，第三个参数表示存在改签订单时需要将新订单支付）
    public int returnOrder(CinemaOder cinemaOder,Object oldOrderNum,String newOrderNum,Integer userinfo);

    //订单完成(扫描取票情景)
    public int finishOrder(CinemaOder cinemaOder);

    //订单失效
    public int orderFailure(Integer scheduleId);

    //用户退票前前先校验票的状态
    public boolean checkReturnCondition(String orderNum);

    //用户改签前先检验票的状态
    public boolean checkChangeCondition(String orderNum);

}
